package io.renren.modules.generator.controller;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import io.renren.modules.generator.entity.GeneratorGroupsEntity;
import io.renren.modules.generator.entity.GeneratorRolesEntity;
import io.renren.modules.generator.service.GeneratorGroupsService;
import io.renren.modules.generator.service.GeneratorRolesService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import io.renren.modules.generator.entity.GeneratorDepartmentEntity;
import io.renren.modules.generator.service.GeneratorDepartmentService;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;



/**
 *
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2021-11-02 10:01:39
 */
@RestController
@RequestMapping("/generator/getAllDictionary")
public class GeneratorDepartmentController {
    @Autowired
    private GeneratorDepartmentService generatorDepartmentService;
    @Autowired
    private GeneratorGroupsService generatorGroupsService;
    @Autowired
    private GeneratorRolesService generatorRolesService;

    /**
     * 列表
     */
    /*@RequestMapping("/list")
   // @RequiresPermissions("generator:generatordepartment:list")
    public R list(*//*@RequestParam Map<String, Object> params*//*){
        List<GeneratorDepartmentEntity> department = generatorDepartmentService.getBaseMapper().selectList(null);
        List<GeneratorGroupsEntity> groups = generatorGroupsService.getBaseMapper().selectList(null);
        List<GeneratorRolesEntity> roles = generatorRolesService.getBaseMapper().selectList(null);
        HashMap<String,List> map = new HashMap<>();
        map.put("department",department);
        map.put("groups",groups);
        map.put("roles",roles);
        System.out.println(department);
        System.out.println(groups);
        System.out.println(roles);
        return R.ok().put("page", map);
    }*/




/*

    */
/**
     * 信息
     *//*

    @RequestMapping("/info/{departmentId}")
    @RequiresPermissions("generator:generatordepartment:info")
    public R info(@PathVariable("departmentId") Integer departmentId){
		GeneratorDepartmentEntity generatorDepartment = generatorDepartmentService.getById(departmentId);

        return R.ok().put("generatorDepartment", generatorDepartment);
    }

    */
/**
     * 保存
     *//*

    @RequestMapping("/save")
    @RequiresPermissions("generator:generatordepartment:save")
    public R save(@RequestBody GeneratorDepartmentEntity generatorDepartment){
		generatorDepartmentService.save(generatorDepartment);

        return R.ok();
    }

    */
/**
     * 修改
     *//*

    @RequestMapping("/update")
    @RequiresPermissions("generator:generatordepartment:update")
    public R update(@RequestBody GeneratorDepartmentEntity generatorDepartment){
		generatorDepartmentService.updateById(generatorDepartment);

        return R.ok();
    }

    */
/**
     * 删除
     *//*

    @RequestMapping("/delete")
    @RequiresPermissions("generator:generatordepartment:delete")
    public R delete(@RequestBody Integer[] departmentIds){
		generatorDepartmentService.removeByIds(Arrays.asList(departmentIds));

        return R.ok();
    }
*/

}
